Video Channel Callback Functions
Sequence grabber components allow you to define a number of callback functions in your application. The sequence grabber calls your functions at specific points in the process of collecting, compressing, and displaying the source video data. By defining callback functions, you can control the process more precisely or customize the operation of the sequence grabber component.For example, you could use a callback function to draw a frame number on each video frame as it is collected. You could use either a compress callback function or a grab-complete callback function to accomplish this. The compress callback function
is called after each frame is collected, in order to compress the frame. The grab-complete callback function is called just before the compress callback function, as soon as the frame has been captured.The
SGSetVideoBottlenecks
function lets you assign callback functions to a video channel. You can use theSGGetVideoBottlenecks
function to determine the callback functions that have been assigned to a video channel.The
SGSetVideoBottlenecks
function accepts a video bottlenecks structure that identifies the callback functions to be assigned to the channel. In addition, theSGGetVideoBottlenecks
function contains a pointer to this structure.The video bottlenecks structure is defined by the
VideoBottles
data type as follows:
struct VideoBottles { short procCount; /* count of callbacks */ GrabProc grabProc; /* grab function */ GrabCompleteProc grabCompleteProc; /* grab-complete function */ DisplayProc displayProc; /* display function */ CompressProc compressProc; /* compress function */ CompressCompleteProc compressCompleteProc; /* compress-complete function */ AddFrameProc addFrameProc; /* add-frame function */ TransferFrameProc transferFrameProc;/* transfer-frame function */ GrabCompressCompleteProc grabCompressCompleteProc; /* grab-compress-complete function */ DisplayCompressProc displayCompressProc; /* display-compress function */ }; typedef struct VideoBottles VideoBottles;
Field Description
procCount
- Specifies the number of callback functions that may be identified in the structure. Set this field to 9.
grabProc
- Identifies the grab function. If you are setting a grab function, set this field so that it points to the function's entry point. If you are not setting a grab function, set this field to
nil
.grabCompleteProc
- Identifies the grab-complete function. If you are setting a grab-complete function, set this field so that it points to
the function's entry point. If you are not setting a grab-complete function, set this field tonil
.displayProc
- Identifies the display function. If you are setting a display function, set this field so that it points to the function's entry point. If you are not setting a display function, set this field to
nil
.compressProc
- Identifies the compress function. If you are setting a compress function, set this field so that it points to the function's entry point. If you are not setting a compress function, set this field to
nil
.compressCompleteProc
- Identifies the compress-complete function. If you are setting a compress-complete function, set this field so that it points to
the function's entry point. If you are not setting a compress-complete function, set this field tonil
.addFrameProc
- Identifies the add-frame function. If you are setting an add-frame function, set this field so that it points to the function's entry point. If you are not setting an add-frame function, set this field to
nil
.transferFrameProc
- Identifies the transfer-frame function. If you are setting a transfer-frame function, set this field so that it points to
the function's entry point. If you are not setting a transfer-frame function, set this field tonil
.grabCompressCompleteProc
- Identifies the grab-compress-complete function. If you are setting a grab-compress-complete function, set this field so that it points to the function's entry point. If you are not setting a grab-compress-complete function, set this field to
nil
.displayCompressProc
- Identifies the display-compress function. If you are setting a display-compress function, set this field so that it points to
the function's entry point. If you are not setting a display-compress function, set this field tonil
.
Subtopics
- SGSetVideoBottlenecks
- SGGetVideoBottlenecks
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help